package com.zhage.controller;

import com.zhage.domain.Student;
import com.zhage.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("stu")
@Controller
public class StudentController {

    @Autowired
    StudentService studentService;

    @RequestMapping("all")
    public String showAll(Model model){
        List<Student> all = studentService.findAll();
        model.addAttribute("stus",all);
        return "lalala";
    }
}
